package com.ljkj.cordial.chat.adapter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.ljkj.cordial.chat.R;
import com.nic.view.adapter.CommonAdapter;

import butterknife.BindView;
import butterknife.ButterKnife;

public class ListPopAdapter extends CommonAdapter<String> {
    @Override
    public View getBindView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder;
        if (convertView == null) {
            convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_bottom_list_pop, null);
            holder = new ViewHolder(convertView);
            convertView.setTag(holder);
        } else {
            holder = (ViewHolder) convertView.getTag();
        }
        String item = (String) getItem(position);
        holder.tvName.setText(item);
        return convertView;
    }

    static
    class ViewHolder {
        @BindView(R.id.tv_name)
        TextView tvName;

        ViewHolder(View view) {
            ButterKnife.bind(this, view);
        }
    }
}
